package cn.iocoder.yudao.module.blog.dal.mysql.postertype;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.blog.dal.dataobject.postertype.PosterTypeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.blog.controller.admin.postertype.vo.*;

/**
 * 海报类型 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface PosterTypeMapper extends BaseMapperX<PosterTypeDO> {

    default PageResult<PosterTypeDO> selectPage(PosterTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PosterTypeDO>()
                .likeIfPresent(PosterTypeDO::getName, reqVO.getName())
                .betweenIfPresent(PosterTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PosterTypeDO::getId));
    }

    default List<PosterTypeDO> selectList(PosterTypeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<PosterTypeDO>()
                .likeIfPresent(PosterTypeDO::getName, reqVO.getName())
                .betweenIfPresent(PosterTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PosterTypeDO::getId));
    }

}
